<?php
 class ClassAction extends Action{
 	public function index(){
 		$db=M();
 		$id=$_GET['class_id'];//get获得分类id
 		import('ORG.Util.Page');
 		$sql1="select count(*) tot from shop where class_id={$id} and shelf='1'";
 		$tot=$db->query($sql1);
 		$count=$tot[0]['tot'];
 		$page= new Page($count,12);
 		$page->setConfig('header','个商品');//属性设置
 		$show=$page->show();
 		$sql2="select * from shop where class_id={$id} and shelf='1' limit {$page->firstRow},{$page->listRows}";
 		$classShops=$db->query($sql2);
 		$this->assign('classShops',$classShops);
 		$this->assign('show',$show);
 		$this->display();
 	}
 }
?>